{\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f3\fswiss Helvetica;\f2\fmodern Courier;}
\paperw9840
\paperh7820
\margl120
\margr120
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs28 NeXT mail vs. Unix Mail\
\
Q:  I don't get my mail on a NeXT computer, but people with NeXT computers sometimes send me messages with NeXT Mail attachments.  How can I decipher these using Unix mail?\
\
A:  You can decode the mail by hand if you want to.  Note that this format is likely to change in a future release.  Follow these steps in a shell in order to read the message:\
\
1. At the prompt in the 
\b mail 
\b0 utility, type\

\f3\fs24  
\f2 	s
\f3\i  
\f2 foo
\f3\i0  \
 
\f0\fs28 to save the message as a file named
\f3\fs24   
\i foo
\i0 .\
\

\f0\fs28 2. Open the file 
\i foo
\i0  with your favorite editor.  After the mail header information is a line   with this format:\

\f3\fs24 	
\f2 begin 0
\f3  
\f2\i tarfile
\f3\i0 \

\f0\fs28 Remember the name that appears in place of tarfile, because uudecode will create a file with this name.\
       \

3.  Decode the file  (this creates tarfile, leaving 
\i foo
\i0  intact):
\f3\fs24 \
	 
\f2 uudecode
\f3  
\f2\i foo
\f3\i0 \
	\

\f0\fs28 4.  Change the permission on  tarfile and move it to the desired place.  The new filename must end with the suffix ".Z".  (Note that tarfile begins with a period so it will be invisible with a normal 
\b ls
\b0  command; use
\b  ls -a
\b0  instead if you want to verify that it's there.)\
	
\f2\fs24 chmod 666
\f3  
\f2\i tarfile
\f3\i0 \
	
\f2 mv 
\i tarfile
\i0  
\i mailmsg.Z
\f3\i0 \
		 \

\f0\fs28 5.  Uncompress it (this will create a file called
\i  mailmsg
\i0  and remove 
\i mailmsg.Z
\i0 ): 
\f3\fs24      \
	
\f2 uncompress 
\i mailmsg.Z
\f3\i0 \
\

\f0\fs28 6.  For the final step,  
\i mailmsg
\i0  should be in a directory by itself so that when the message is unparsed the various files are easy to find.  \

\f3\fs24 	
\f2 mkdir 
\i newdir
\i0 \
	mv 
\i mailmsg newdir
\i0 \
	cd 
\i newdir
\i0 \
	tar xvf 
\i mailmsg
\i0 \

\f3 \

\f0\fs28 The
\b  tar
\b0  command will show you the files it has unparsed.  One of them is called index.rtf.  This is the body of the message in Rich Text Format (RTF).  The rest of the files and directories are the attachments.  Hopefully they are files that can be opened on the receiving system.   If you have an editor that can read RTF files, use it to open index.rtf .  It will have the body of the text.  There will be no text if just an attachment was sent.  \

\f3\fs24 \

\f0\fs28 The rest of this NextAnswers entry discusses what to do if your editor can't read RTF files.\

\f3\fs24 \

\f0\fs28 Open 
\i index.rtf 
\i0  with your editor.   Much of the text in this file is RTF formatting.  The curly braces and words starting with `\\' are RTF directives.  You can ignore them for the most part; they introduce formatting and text style information.  The only interesting directive is  
\i \\attachment#
\i0 .  It is the placeholder for an attachment that has been placed in the directory.  The group 
\i \{/attachment# filename \}
\i0   is the information for the attachment.\

\f3\fs24 \

\f0\fs28 In the following example, the section in black is the attachment information.  This attachment is the file called 
\i attachmentNam
\i0 e.   There is no regular text in this message.
\f3\fs24 \

\f2\fs20\gray333 \
\{\\rtf0\\ansi\{\\fonttbl\\f0\\fmodern Courier;\\f1\\fmodern Ohlfs;\}\
\\margl120\
\\margr120\

\gray0 \{\\attachment0 attachmentName\
\}
\gray333 \
\{\\f1\\fs20\\fi0\\li0\\ql\\gray0 \\\
\}\
\}
\f3\fs24\gray0 \
\

\f0\fs28 In the following example, there is only text.  The words in black are the ones you are interested in:\
\

\f2\fs20\gray333 \{\\rtf0\\ansi\{\\fonttbl\\f1\\fmodern Ohlfs;\\f0\\fswiss Helvetica;\\f3\\fmodern Courier;\\f2\\froman Times;\}\
\\margl120\
\\margr120\
\{\\f1\\fs20\\fi0\\li0\\ql\\gray0 
\gray0 this is some rich text
\gray333 \}\
\{\\f0\\fs20\\fi0\\li0\\ql\\gray0 
\gray0  this is some helvectica
\gray333 \\\
\\\

\gray0 this is more helvetica
\gray333 \\\
\}\
\{\\f0\\fs20\\fi0\\li0\\ql\\gray0 \\\
\}\
\{\\f2\\b\\fs20\\fi0\\li0\\ql\\gray0
\gray0  This is times bold
\gray333 \}\
\{\\f0\\fs20\\fi0\\li0\\ql\\gray0
\gray0  .
\gray333 \\\
\\\

\gray0 and another line of text
\gray333 \\\
\}\
\}
\f3\fs24\gray0 \
\

}
